/**
 * MAP A的Reducer
 * 初始化state的各种字段，并对应action进行映射。
 * @author majun
 * @date 2017/5/4
 */
import { UPDATE_MAP, INCREASE_DATA, INCREASE_REFRESH_TIME } from '../actions/doMapA';

const doMapData = (state = { config: {}, series: [], time: 0 }, actions) => {

	switch(actions.type) {
		case UPDATE_MAP:
			return Object.assign({}, state, {
				config: actions.config
			})
		case INCREASE_DATA:
			return Object.assign({}, state, {
				series: actions.series
			})
		case INCREASE_REFRESH_TIME:
			return Object.assign({}, state, {
				time: state.time + 1
			})
		default:
			return state
	}
}

export default doMapData